package ribbonconfiguration;

import com.eagle.scali.contentcenter.configuration.NacosSameClusterWeightedRule;
import com.eagle.scali.contentcenter.configuration.NacosWeightedRule;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 根据Nacos上的权重，去调节流量
 */
@Configuration
public class RibbonConfiguration {
	@Bean
	public IRule ribbonRule(){
//		return new RandomRule();
//		return new NacosWeightedRule();
		return new NacosSameClusterWeightedRule();
	}
}
